#!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
# Copyright 2011 zod.yslin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 
# Author: zod.yslin
# Email: 
# File Name: read.py
# Description: 
#   To read a file’s contents, call f.read(size), which reads some quantity of
#   data and returns it as a string. size is an optional numeric argument. 
#   When size is omitted or negative, the entire contents of the file will be 
#   read and returned; it’s your problem if the file is twice as large as your 
#   machine’s memory. Otherwise, at most size bytes are read and returned. 
#   If the end of the file has been reached, f.read() will return an empty string ("").
# Edit History: 
#   2011-10-18    File created.
#===============================================================================
f = open('read.py', 'r')
print(f.read(6))
print(f.read())
